export function find_parent(ele: HTMLElement | null, fn: (ele: Element) => any): HTMLElement | undefined {
  while (true) {
    if (!ele) return void 0;
    if (fn(ele)) return ele;
    ele = ele.parentElement;
  }
}
